<script setup>
import { artGetChannelsService } from '@/api/article.js'
import { ref } from 'vue'

defineProps({
  modelValue: {
    type: [Number, String],
  },
})
const emit = defineEmits(['update:modelValue'])
const channelList = ref([])
const getChannelsService = async () => {
  const res = await artGetChannelsService()
  channelList.value = res.data.data
}
getChannelsService()
</script>

<template>
  <el-select :modelValue="modelValue"
             @update:modelValue="emit('update:modelValue',$event)" class="select">
    <el-option v-for="channel in channelList" :key="channel.id" :label="channel.cate_name"
               :value="channel.id"></el-option>
  </el-select>
</template>

<style lang="scss" scoped>
.select{
  min-width: 150px;
}
</style>